package com.waimai.www.service;

import java.sql.SQLException;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;

import com.waimai.www.controller.CaipinController;
import com.waimai.www.dao.CaipinMapper;
import com.waimai.www.po.Caipin;




//物品服务层
public class CaipinService {
 
	@Autowired CaipinMapper caipinMapper ;
	public List<Caipin> getAllCaipinByFirstCode(String firstCode,String keyword) throws SQLException {
		// TODO Auto-generated method stub
		return caipinMapper.getAllCaipinByFirstCode(firstCode,keyword);
	}
	
//	通过物品id查询物品信息
	public Caipin getCaipinById(String id,String fname) throws SQLException {
		// TODO Auto-generated method stub
		return caipinMapper.getCaipinById(fname);
	}


	public Map<String, String> getAllFirstCaipin() throws SQLException {
		// TODO Auto-generated method stub

		Map<String,String> maps = caipinMapper.getAllFirstCaipin();
		return maps;
	}

	//根据一级物品类型获取二级物品类型
	public Map<String, String> getAllSecondCaipin(String typeCode) throws SQLException {
		// TODO Auto-generated method stub
		return caipinMapper.getAllSecondCaipin(typeCode);
	}

	public Caipin getCaipinById(String string) {
		// TODO Auto-generated method stub
		return null;
	}
	

}